file(GLOB_RECURSE cc_sources *.cc)

add_library(buolacv SHARED ${cc_sources})

find_package(OpenCV REQUIRED core calib3d imgproc features2d nonfree)

if(BUOLA_HAVE_OPENNI2)
    target_link_libraries(buolacv ${LIB_OPENNI2})
elseif(BUOLA_HAVE_OPENNI)
    include_directories(SYSTEM ${OPENNI_INCLUDE_DIRS})
    target_link_libraries(buolacv ${OPENNI_LIBRARIES})
elseif(BUOLA_HAVE_FREENECT)
    target_link_libraries(buolacv ${LIB_FREENECT})
endif()

target_link_libraries(buolacv buolagui buolascene ${OpenCV_LIBS})

set_target_properties(buolacv PROPERTIES VERSION ${GENERIC_LIB_VERSION} 
                                        SOVERSION ${GENERIC_LIB_SOVERSION})
install(TARGETS buolacv DESTINATION ${LIB_INSTALL_DIR})
